import requests
import os

url = "http://n.sinaimg.cn/news/crawl/117/w550h367/20220417/a3a9-08b2ca6dffe4210149dda424adf0734f.jpg"
response = requests.get(url)
desktop_path = os.path.join(os.path.expanduser("~"), 'Desktop')
file_path = os.path.join(desktop_path, 'photo.jpg')
with open(file_path, 'wb') as f:
    f.write(response.content)
print("已将照片保存至桌面的photo.jpg文件")
